#include "game.h"
#include "Room.h"
#include "ASprite.h"
#include "Box2D.h"


Room::Room()
{
	SetObjectType(Object_Room);	
}

void Room::Initialize()
{	

	InitPhysics();
}


void Room::InitPhysics()
{	
	{
		b2PolygonDef sd;
		

		b2BodyDef bd;
		bd.position.Set(0, 0);
		m_physicsBody = GetGameObjectManager()->GetPhysicsWorld().CreateBody(&bd);
		sd.SetAsBox(10.0f, 0.1f,b2Vec2(5, -0.11f), 0.0f);
		m_physicsBody->CreateShape(&sd);

		sd.SetAsBox(10.0f, 0.1f,b2Vec2(5, 4.8f), 0.0f);
		m_physicsBody->CreateShape(&sd);

		sd.SetAsBox(0.1f, 8.0f,b2Vec2(0.0f, -0.0f), 0.0f);
		m_physicsBody->CreateShape(&sd);

		sd.SetAsBox(0.1f, 8.0f,b2Vec2(9.0f, -0.0f), 0.0f);
		m_physicsBody->CreateShape(&sd);

		m_physicsBody->SetUserData( this );
	}
}